|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectj3deditor.bin.hierarchy.GeometryManipulator
public class GeometryManipulator
Tool for manipulating data contained in the
specified J3DeGeometryArray.
J3DeGeometryArray| Field Summary | |
|---|---|
static int |
NONE
Transform mode, specifies that vertices can not be transformed. |
static int |
ROTATE
Transform mode, specifies that selected vertices can be rotated. |
static int |
SCALE
Transform mode, specifies that selected vertices can be scaled. |
static int |
TEX_COORDS
Specifies that the manipulation target of this GeometryManipulator are texture coordinates. |
static int |
TRANSLATE
Transform mode, specifies that selected vertices can be translated. |
static int |
VERT_COORDS
Specifies that the manipulation target of this GeometryManipulator are vertex coordinates. |
| Constructor Summary | |
|---|---|
GeometryManipulator(J3DeGeometryArray geometry,
int manipulationTarget)
Creates an instance of GeometryManipulator which
manipulates the data contained in the sepcified J3DeGeometryArray. |
|
| Method Summary | |
|---|---|
boolean |
addVertex(float x,
float y,
float z)
Adds a new vertex to the specified position. |
boolean |
areFacesSelected()
Returns true if selected faces array is not null. |
J3DeGeometryArray |
changeGeometrySize(int newSize)
Creates and returns new J3DeGeometryArray object
with the specified size (vertex data will be also copied to new object). |
void |
deleteSelectedFaces()
Deletes selected faces. |
void |
deselectAllVertices()
Sets the state of all "selected" vertices to "normal". |
void |
deselectFaces()
Deselects all faces. |
void |
flipFaces()
Flips the face normals of all selected faces. |
int |
getAllVertCount()
Returns the number of vertices the J3DeGeometryArray contains. |
Vertex |
getCenter()
Returns a vertex that represents the center of selected vertices. |
J3DeGeometryArray |
getGeometry()
Returns the J3DeGeometryArray object which data this
GeometryManipulator manipulates. |
int[] |
getScaleAxes()
Returns the currently used scale axes multiplicators. |
Vertex[][] |
getSelectedFaces()
Returns the array of selected faces. |
float |
getTexCoord(int axis)
Returns the texture coordinate value of the specified axis of the first selected vertex if texture coordinates are enabled. |
Vertex[] |
getTransformableVertices()
Returns an array that contains all selected vertices. |
int |
getTransformMode()
Returns current transform mode. |
Vertex |
getVertex(int index)
Returns a vertex at the specified index. |
float |
getVertexAlpha()
Returns the alpha component of the vertex color of the first selected vertex if available. |
java.awt.Color |
getVertexColor()
Returns the color of the first selected vertex if available. |
int |
getVertexCount()
Returns the number of valid vertices. |
boolean |
hasTexture()
Returns true if polygonal mesh is able to store texture coordinates. |
void |
hideSelectedVertices()
Sets the state of the selected vertices to "hidden". |
void |
hideVertices(Vertex[] vertices)
Sets the state of the given vertices to "hidden". |
protected void |
invertVertices(Vertex[] face)
Inverts the order of vertices in the specified face. |
boolean |
isStickyVertsEnabled()
Returns true if "sticky vertices" is enabled. |
void |
mergeSelectedVertices()
Moves all selected vertices to the center of the selection. |
protected void |
mergeVertices(Vertex[] vertices)
Moves the specified vertices to the center of the selection. |
void |
rotateVertices(float rotation,
int axis)
All transformable (selected) vertices are rotated around the specified axis by specified angle. |
void |
scaleVertices(float scaleChange)
All transformable (selected) vertices are scaled using the specified value (relatively to selection center). |
void |
selectFaces(boolean allVerts)
Selects faces by grouping selected vertices into Vertex[][] array and selecting additional
vertices if needed. |
void |
setScaleAxes(int[] axes)
Specifies how much polygonal mesh is scaled on each axis when used scaleVertices method. |
void |
setStickyVertsEnabled(boolean stickyVerts)
Specifies if the "sticky vertices" is enable or not. |
void |
setTexCoord(float coordinate,
int axis)
Applies the specified texture coordinate value to all selected vertices on specified axis if texture coordinates are enabled. |
void |
setTexCoordSet(int set)
Specifies the texture coordinate set which coordinates can be manipulated if this GeometryManipulator manipulates texture coordinates
and geometry has texture coordinates. |
void |
setTransformMode(int transformMode)
Specifies the vertex manipulation mode. |
void |
setVertexAlpha(float alpha)
Applies the specified alpha component to the vertex color of selected vertices if 4-component vertex color is enabled. |
void |
setVertexColor(java.awt.Color color)
Applies the specified color to the selected vertices if vertex color is enabled. |
void |
showAllVertices()
Makes all hidden vertices visible. |
void |
translateVertices(float[] coordinateChange)
All transformable (selected) vertices are translated using the specified value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NONE
public static final int TRANSLATE
public static final int ROTATE
public static final int SCALE
public static final int VERT_COORDS
public static final int TEX_COORDS
| Constructor Detail |
|---|
public GeometryManipulator(J3DeGeometryArray geometry,
int manipulationTarget)
GeometryManipulator which
manipulates the data contained in the sepcified J3DeGeometryArray.
geometry - GeometryManipulator which data can be manipulated
by this GeometryManipulatormanipulationTarget - specifies which coordinates can be manipulated with
translateVertices(), scaleVertices() and rotateVertices()
methods.VERT_COORDS and TEX_COORDS can be used.| Method Detail |
|---|
public void setTexCoordSet(int set)
GeometryManipulator manipulates texture coordinates
and geometry has texture coordinates.
set - index of texture coordinate setpublic void setScaleAxes(int[] axes)
scaleVertices method.
axes - multiplicator on each axis (3 axes: X, Y and Z)public int[] getScaleAxes()
setScaleAxes(int[] axes)public J3DeGeometryArray getGeometry()
J3DeGeometryArray object which data this
GeometryManipulator manipulates.
J3DeGeometryArray object which data this
GeometryManipulator manipulatespublic int getVertexCount()
public int getAllVertCount()
J3DeGeometryArray contains.
J3DeGeometryArray containsGeometryArray.getVertexCount()public Vertex getVertex(int index)
index - index of requested vertex
public void deselectAllVertices()
public Vertex[] getTransformableVertices()
public Vertex getCenter()
public int getTransformMode()
public void setTransformMode(int transformMode)
View2D
objects which use this GeometryManipulator.
transformMode - new vertex manipulation mode.NONE - vertices cannot be transformedTRANSLATE - vertices can be translatedROTATE - vertices can be rotatedSCALE - vertices can be scaledpublic void translateVertices(float[] coordinateChange)
coordinateChange - how much are vertices moved on each axis.public void scaleVertices(float scaleChange)
scaleChange - new size of the scalable part of polygonal mesh.scaleChange < 1 - selected part of the polygonal mesh is made smallerscaleChange > 1 - selected part of the polygonal mesh is made larger
public void rotateVertices(float rotation,
int axis)
rotation - rotation angle in radiansaxis - 1 - X-axispublic boolean isStickyVertsEnabled()
setStickyVertsEnabled(boolean stickyVerts)public void setStickyVertsEnabled(boolean stickyVerts)
VertexManipulator.
stickyVerts - true - enabled; otherwise notVertexManipulator.selectVertex(J3DePoint2D p, Scene2D scene, boolean isShiftDown)
public boolean addVertex(float x,
float y,
float z)
x - X-coordinate of the vertexy - Y-coordinate of the vertexz - Z-coordinate of the vertex
public void selectFaces(boolean allVerts)
Vertex[][] array and selecting additional
vertices if needed.
allVerts - if true only those faces are selected which all vertices are selected,
otherwise those faces are selected which have at least one selected vertexpublic boolean areFacesSelected()
public void deselectFaces()
public Vertex[][] getSelectedFaces()
public void deleteSelectedFaces()
public J3DeGeometryArray changeGeometrySize(int newSize)
J3DeGeometryArray object
with the specified size (vertex data will be also copied to new object).
This GeometryManipulator will also uses this new object to
manipulate vertex data.
newSize - new size of the polygonal mesh
J3DeGeometryArray object
with the specified sizepublic boolean hasTexture()
public void hideVertices(Vertex[] vertices)
vertices - vertices which state will be changedpublic void hideSelectedVertices()
public void showAllVertices()
protected void invertVertices(Vertex[] face)
face - face which vertices will be invertedpublic void flipFaces()
protected void mergeVertices(Vertex[] vertices)
vertices - vertices which will be mergedpublic void mergeSelectedVertices()
public java.awt.Color getVertexColor()
public void setVertexColor(java.awt.Color color)
color - color that will be applied to selected vertices
if vertex color is enabledpublic float getVertexAlpha()
public void setVertexAlpha(float alpha)
alpha - alpha component which will be applied to
the selected verticespublic float getTexCoord(int axis)
axis - axis of the texture coordinates.
public void setTexCoord(float coordinate,
int axis)
coordinate - value which will be applied to all selected verticesaxis - texture coordinate axis: 0 - S, 1 - T, 2 - R, 3 - Q
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||